package com.wzvtc.vsl.securitytool;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

/**
 * Created by Vsl on 2015/3/24.
 */
public class LostFindActivity extends Activity {
    private TextView tv_safenumber;
    private TextView tv_protect;
    private SharedPreferences sp;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        sp = getSharedPreferences("config", MODE_PRIVATE);
        boolean configed = sp.getBoolean("configed", false);
        if (configed) {
            setContentView(R.layout.activity_lost_find);
            tv_safenumber = (TextView) findViewById(R.id.tv_safenumber);
            tv_protect = (TextView) findViewById(R.id.tv_protect);

            tv_safenumber.setText(sp.getString("safenumber", ""));

            boolean protect = sp.getBoolean("protect", false);
            if(protect){
                tv_protect.setText("已打开");
            }else{
                tv_protect.setText("未打开");
            }
        } else {
            Intent intent = new Intent(LostFindActivity.this, Setup1Activity.class);
            startActivity(intent);
            finish();
        }
    }

    public void reEnterSetup(View view) {
        Intent intent = new Intent(LostFindActivity.this, Setup1Activity.class);
        startActivity(intent);
        finish();
    }
}
